package com.twu.biblioteca.service;

import com.twu.biblioteca.model.movieModel;

/**
 * Created with IntelliJ IDEA.
 * User: st
 * Date: 14-4-21
 * Time: 下午5:26
 * To change this template use File | Settings | File Templates.
 */
public class setupMovieList {
    public static movieModel setMovie(String movieName, String movieYear, String director, String rating, boolean checkStatus) {
        movieModel movie = new movieModel();
        movie.setMovieName(movieName);
        movie.setMovieYear(movieYear);
        movie.setDirector(director);
        movie.setRating(rating);
        movie.setCheckStatus(checkStatus);
        return movie;
    }

    public static movieModel[] setMovieList(movieModel[] movieList) {
        movieList[0]= setMovie("AI","2001","Steven Allan Spielberg","8.5",false);
        movieList[1]=setMovie("Ashes of Time","1994","Karwai Wong","8.5",false);
        movieList[2]=setMovie("The Avengers","2012","Joss Whedon","8.2",false);
        return movieList;  //To change body of created methods use File | Settings | File Templates.
    }

    public void printMovieList(movieModel movieList[]){
        int len=0;
        System.out.println("Movie name"+"\t"+"     Year"+"\t"+"Director       Rating");
        while (len<movieList.length&&movieList[len]!=null){
            if(!movieList[len].getCheckStatus()){
                System.out.println(movieList[len].getMovieName()+"  "+movieList[len].getMovieYear()+"  "+movieList[len].getDirectorName()
                        +"  "+movieList[len].getRating());
            }
            len++;
        }
    }
}
